<html>
<head>
	<title>Persistent Database Connection Pooling</title>
	<link rel="stylesheet" href="../css/styles.css">
</head>
<body>
<h1>Persistent Database Connection Pooling</h1>

<p>Solves - "I've analyzed my app's performance and it seems to be spending a lot of time just logging in to the database."</p>

<p>Logging in to most databases takes a noticable amount of time...</p>

<p><img src="../images/app-to-db.png"/></p>

<p>So much time, in fact, that transient apps (such as web-based applications) which start up, connect, query, disconnect, and shut down to deliver each bit of content, often take longer to log in than to run the queries.  As a result, overall throughput (queries-per-second) is generally low unless many queries are run per connection.</p>

<p>A persistent database connection pool maintains a pool of already-logged-in database connections, and logging in to a connection pool is substantially faster than logging into the database directly.</p>

<p><img src="../images/app-to-sqlr-to-db.png"/></p>

<p>As a result, overall throughput (queries-per-second) is maximized, and doesn't depend nearly as much on the number of queries that are run per connection.</p>

<p><a href="../images/mysql-bench.png"><img style="width: 320; height: 240; " src="../images/mysql-bench.png"/></a>
<a href="../images/oracle-bench.png"><img style="width: 320; height: 240; " src="../images/oracle-bench.png"/></a></p>

<p>(<a target="_blank" href="http://software.firstworks.com/p/current-sql-relay-benchmarks.html">Current Benchmarks</a>)</p>

<p>Many connection pooling systems are built into application servers or run within a web-server but can only be used by applications running within that server and usually only by applications written in a particular language.  SQL Relay runs stand-alone and may be used by any application, including applications running on other machines across the network.  This is especially useful if you have a variety of apps, written in different languages, running on various platforms that all need to talk to the same database.
</p>

</body>
</html>
